<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('管理费列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <div style="height: 30px;width: 800px;background-color: rgba(204, 204, 204, 1);line-height: 30px">
                    <span style="margin-left: 20px;font-weight: bold">个人价格</span>
                </div>

                <div style="height: 30px;width: 800px;line-height: 30px;margin-left: 20px;">
                    <span style="font-weight: bold">价格：</span>2000元，外地+1000元
                </div>

                <div style="height: 30px;width: 800px;background-color: rgba(204, 204, 204, 1);line-height: 30px">
                    <span style="margin-left: 20px;font-weight: bold">管理费</span>
                </div>
                <span style="color: red">管理费缴纳说明：</span><br/>
                <span style="font-size: 12px">管理费缴纳说明：1. 每月1号 -- 10号为管理费缴纳期间；</span><br/>
                <span style="font-size: 12px">2. 管理费滞纳金额度：若11号--20号之间缴纳为1级延迟，费用上浮20%，20号-31号之间缴纳为二级延迟，费用上浮50%；</span><br/>
                <span style="font-size: 12px">3. 若当月未交管理费，则次月起不可接单、前台不可被查询到；</span><br/>

            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('other:paycost:edit')}]];
        var removeFlag = [[${@permission.hasPermi('other:paycost:remove')}]];
        var prefix = ctx + "other/paycost";

        $(function() {

            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "管理费",
                columns: [
                {
                    field : 'costId', 
                    title : '编号',
                    visible: false
                },
                {
                    field : 'costMonth',
                    title : '月份',
                    align : 'center',
                    formatter: function (value,row,index) {
                        return row.costYear+"年"+row.costMonth+"月";
                    }
                },
                {
                    field : 'costMoney', 
                    title : '管理费',
                    align : 'center',
                },
                {
                    field : 'costOverdue', 
                    title : '罚金',
                    align : 'center',
                    formatter: function (value, row, index) {
                        if (row.costPaystate == 1 || row.costPaystate == 2 || row.costPaystate == 3) {
                            return "<span style='color: red'>"+value+"</span>";
                        }
                        if(row.costPaystate == null || row.costPaystate == ""){
                            return "0";
                        }
                    }
                },
                {
                    field : 'shouldCost',
                    title : '应交额度',
                    align : 'center',
                    formatter: function (value,row,index) {
                        //alert(row.costOverdue);
                        var shouldCost = row.costMoney+row.costOverdue;
                        return shouldCost;
                    }
                },
                {
                    field : 'costPaystate',
                    title : '缴纳状态',
                    align : 'center',
                    formatter: function (value, row, index) {
                        if(value == 0){
                            return "<span>已正常缴纳</span>";
                        }
                        if (value == 1) {
                            return "<span style='color: red'>待缴纳</span>";
                        }
                        if (value == 2) {
                            return "<span style='color: red'>待缴纳，一级延迟</span>";
                        }
                        if (value == 3) {
                            return "<span style='color: red'>待缴纳，二级延迟</span>";
                        }
                        if (value == 4) {
                            return "<span>已缴纳，一级延迟</span>";
                        }
                        if (value == 5) {
                            return "<span>已缴纳，二级延迟</span>";
                        }
                    }
                },
                {
                    field : 'costPaytime', 
                    title : '缴纳时间',
                    align : 'center',
                    formatter: function (value, row, index) {
                        if(value == null || value == ""){
                            return "<span style='text-align: center'>----</span>";
                        }else {
                            return value;
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        /*var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.costHostid + '\')"><i class="fa fa-edit"></i>立即缴纳</a> ');*/
                        //return actions.join('');
                        if(row.costPaystate == 1 || row.costPaystate == 2 || row.costPaystate == 3){
                            return "<a href='#' style='color: red'>立即缴纳</a>";
                        }else {
                            return "已缴纳";
                        }

                    }
                }]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>